home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 13 / AMIGAplus Sonderheft 13 (1998)(ICP)(DE)[!].iso / rexx / numberlines.bed < prev    next >
Text File  |  1997-12-03  |  591b  |  43 lines

  1. /*
  2. ** $VER: NumberLines.bed 1.0 (02.01.96)
  3. **
  4. ** Add number lines to the selected block or to the whole document
  5. **
  6. ** Modified by Marco Negri
  7. */
  8.  
  9. OPTIONS RESULTS
  10.  
  11. SetInputLock ON
  12. SetDisplayLock ON
  13.  
  14. GetBlkDims
  15. PARSE VAR RESULT mode . first . last
  16.  
  17. IF mode = OFF THEN DO
  18.     GetFileInfo
  19.     num = WORD(RESULT,1)
  20.     first = 0
  21. END; ELSE DO
  22.     num = last - first + 1
  23. END
  24.  
  25. SetBookmark 0
  26. SetStatusBar "Adding line numbers..."
  27.  
  28. Move LINE first
  29.  
  30. pad = LENGTH(num)
  31.  
  32. DO i=1 TO num
  33.     MoveSOL
  34.     Text '"' || RIGHT(i,pad,' ') || ':"'
  35.     MoveDown
  36. END
  37.  
  38. MoveBookmark 0
  39. ClearBookmark 0
  40.  
  41. SetDisplayLock OFF
  42. SetInputLock OFF
  43.